Telegram Group & Telegram Channel
137. Program to check whether the number is palindrome or not using recursion.

#include<stdio.h>

int checkPalindrome(int);

int main() {

int n, sum;

printf("Enter a number : ");
scanf("%d",&n);

sum = checkPalindrome(n);

if(n == sum)
printf("%d is a palindrome", n);
else
printf("%d is not a palindrome", n);

return 0;
}

int checkPalindrome(int n) {

static int sum=0, r;
if(n != 0)
{
r = n % 10;
sum = sum * 10 + r;
checkPalindrome(n/10);
}
return sum;
}
@C_Codings



tg-me.com/C_Codings/199
Create:
Last Update:

137. Program to check whether the number is palindrome or not using recursion.

#include<stdio.h>

int checkPalindrome(int);

int main() {

int n, sum;

printf("Enter a number : ");
scanf("%d",&n);

sum = checkPalindrome(n);

if(n == sum)
printf("%d is a palindrome", n);
else
printf("%d is not a palindrome", n);

return 0;
}

int checkPalindrome(int n) {

static int sum=0, r;
if(n != 0)
{
r = n % 10;
sum = sum * 10 + r;
checkPalindrome(n/10);
}
return sum;
}
@C_Codings

BY C Language πŸ‘¨β€πŸ’»


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/C_Codings/199

View MORE
Open in Telegram


C Language ‍ Telegram | DID YOU KNOW?

Date: |

Mr. Durov launched Telegram in late 2013 with his brother, Nikolai, just months before he was pushed out of VK, the Russian social-media platform he founded. Mr. Durov pitched his new appβ€”funded with the proceeds from the VK saleβ€”less as a business than as a way for people to send messages while avoiding government surveillance and censorship.

That strategy is the acquisition of a value-priced company by a growth company. Using the growth company's higher-priced stock for the acquisition can produce outsized revenue and earnings growth. Even better is the use of cash, particularly in a growth period when financial aggressiveness is accepted and even positively viewed.he key public rationale behind this strategy is synergy - the 1+1=3 view. In many cases, synergy does occur and is valuable. However, in other cases, particularly as the strategy gains popularity, it doesn't. Joining two different organizations, workforces and cultures is a challenge. Simply putting two separate organizations together necessarily creates disruptions and conflicts that can undermine both operations.

C Language ‍ from br


Telegram C Language πŸ‘¨β€πŸ’»
FROM USA